Skip to content

feat(ui,docs,e2e): page every console table and draw only the events in view - #300

Merged
V3RON merged 4 commits into
task/297from
task/299
Oct 3, 2026
Merged

V3RON merged 4 commits into
task/297from
task/299

Conversation

@V3RON

@V3RON V3RON commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Closes #299

Every table of a view's items is now one DataTable on @tanstack/react-table, with a pager under it. Pages hold 25, 50 or 100 rows. The page and size live in the URL, under each table's own key (?devices-page=2&leases-page=3). When a refresh shrinks the list, the view moves to the last page; when everything fits on one page, the pager is hidden. Attention is now that table too. Worker cards page at 24, and Busiest workers shows five and links to the cards. Leases are sorted by grant time, so a refresh never moves a row to another page.

The events feed scrolls in a fixed box drawn with @tanstack/react-virtual. While the reader is scrolled down, new events leave the visible row where it is, and an "N new events" button counts them. The feed keeps 10,000 events. There is no <style> element, and de-duplication is unchanged. The pager's select draws its own CSS chevron, with no image, so the CSP is untouched. It was checked in screenshots in all three browsers, light and dark.

Seeding. e2e/console/long-lists.spec.ts starts a fake-driver host with iOS limits of 400. Over the socket it uses simlock/client to take 300 leases, one requester each. It then renews them until GET /v1/events?since=1h holds 5,000 events. The paging tests use page.route to serve made-up lists for one route, on top of the real daemon's answer.

Done when

  • Every table and list is paged, and the feed is virtualized: the eleven spec tests in long-lists.spec.ts pass in all three browsers.
  • The seeded host with 300 leases and 5,000 events stays responsive in all three browsers, measured in the page on a Mac:
    • Twelve page changes per browser, timed from the key press to the new rows: 2–7 ms (limit 250 ms).
    • Scrolling the feed to the bottom, two box heights per frame: p95 frame 17 ms in Chromium and Firefox, 24 ms in WebKit. The worst frame was 50 ms. The box was never blank, and at most 16 rows were in the DOM (limits: p95 under 50 ms, worst under 100 ms, under 100 rows).
  • The browser lane passes in Chromium, Firefox and WebKit: pnpm test:console, 258 passed.

Review

Spec review: 17 findings over 2 rounds, 3 fixed. Code review: 17 findings over 2 rounds, 13 fixed.

Rejected:

  • The diff does not show how responsiveness was checked — it is stated above, where the spec asks for it.
  • The "Minute by minute" tables are not paged — they always have exactly 60 rows, they are a chart's text version rather than a list of items, and the spec's table list does not name them. The docs now say so.
  • Sorting leases by grant time is out of scope — the spec asks that rows keep their order between refreshes, and the daemon's order of GET /v1/leases is not promised. The sort uses only facts a lease keeps for its whole life.
  • The worker cards also offer 48 and 96 per page — "paged the same way" as the tables includes a size choice. 24 is still the default, and 48 and 96 are whole rows of the card grid.
  • A new page size keeps the first row shown in view — the spec gives no rule for this. This is TanStack's own setPageSize behaviour, and the alternative of jumping to page 1 loses the reader's place.
  • The extra tests (axe in light and dark, the filter reset, the lease sort) are outside the spec's list — each checks a line of Web console for the HTTP control plane #88 or a behaviour this diff adds.
  • ARCHITECTURE.md is not a listed module — the docs rule says a change updates the docs it makes true.
  • The spec's eleven tests run in the browser lane, not as unit tests — they need a DOM, scrolling and the URL. The pure paging rules are unit-tested.
  • The pager hides itself, Per page included, when the chosen size holds every row — the spec says to hide the pager when everything fits on one page.
  • The worker cards cut out their page by hand, while tables use TanStack — the cards are not a table. Both read the same usePaging page, and every move goes through one place, Pager.
  • The worker-card pager bar has no AA or 360px test with many workers — it uses the same controls and tokens as the table pager, which those tests cover. Only its edge and fill differ, and both are tokens already checked.
  • CI fix: the scroll test bounded single frames, and WebKit on CI breaks any such bound (one run: 211 ms worst; another: 15 of 662 frames over 100 ms, p95 33). Smoothness is now p95 < 50 ms plus no freeze (< 1 s); rows drawn, blank and newest-first checks are unchanged, so removing virtualization still fails.
  • Focus fix: every one-second refresh redrew each table cell, because TanStack's FlexRender mounted the per-render cell function as a new component, so a focused row link lost focus (the flaky WebKit keyboard test). The table now calls each cell function itself; a new test keeps a focused link focused across two refreshes.

Written by an agent.

…in view

Every table of a view's items is one TanStack table with a pager under it;
the page and size live in the URL query, per table. The worker cards page at
24, Busiest workers shows the top five. The events feed scrolls in a fixed
box, drawn with TanStack Virtual, keeps the reader's row in place while
scrolled down, counts new events in a button, and holds the newest 10,000.
A select draws its own chevron in CSS.

Closes #299
@V3RON
V3RON added this pull request to stack #292 October 3, 2026 10:06
V3RON added 3 commits October 3, 2026 17:56
…efreshes

DataTable drew each cell with TanStack's FlexRender, which mounts a cell function as a
component. The columns are built anew on every render, so every one-second refresh mounted
a new component in every cell, drew its elements afresh, and took focus off a row's link.
The table now calls each column's cell function itself.

A new test focuses a row's link, waits for two refreshes, and checks the same element still
has focus, the rows kept their order, and Enter opens the lease.
@V3RON
V3RON merged commit fb28633 into main Oct 3, 2026
24 checks passed
@V3RON
V3RON deleted the task/299 branch November 6, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Console: long lists

1 participant